<div class="page_head">
<h2><%="Role and Permissions".t%></h2>
</div>
 <%if @project%>
   <%label = "prj_" + @project.id.to_s%>
 <%else%>
   <%label = "com_" + @cur_user.company.id.to_s%>
 <%end%>
<table class=data>
 <tr class=pm_head>
   <th rowspan=2 width=15%><%="Function Category".t%></th>
   <th rowspan=2 width=15%><%="Inherit Parent".t%></th>
   <th colspan=3><%="Permission Items".t%></th>
 </tr>
 <tr class=pm_head>
   <th width=24%><%="View".t%></th>
   <!--
   <th width=20%><%="View".t%> <%="Private".t%></th>
   -->
   <th width=24%><%="New".t%></th>
   <th width=24%><%="Edit".t%></th>
 </tr>
 <tr style="background:#ffc">
   <td align=center>[<%="Whole Project".t%>]</td>
   <td align=center><input type=checkbox checked=false disabled></td>
   <td align=center>
      <%="All People".t%>
   </td>
   <!-- 
   <td id='<%=label%>_parent_private'> <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_private"}%>
   </td>
   -->
   <td id='<%=label%>_parent_new'%>
      <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_new"}%>
   </td>
   <td id='<%=label%>_parent_edit'%>
      <%=render :partial=>'per_item',:locals=>{:container_id=>"#{label}_parent_edit"}%>
   </td>
 </tr>

 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Messages".t,:label=>"#{label}_msg",:right=>false}%>

     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_msg_cat",:right=>true}%>
   <%(@project.nil? ? @cur_user.company : @project).msg_categories.each do |cat|%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_msg_cat",:right=>true}%>
   <%end%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Todo Items".t,:label=>"#{label}_todo",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Milestones".t,:label=>"#{label}_ms",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Writeboards".t,:label=>"#{label}_wb",:right=>false}%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_wb_cat",:right=>true}%>
   <%(@project.nil? ? @cur_user.company : @project).wb_categories.each do |cat|%>
    <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_wb_cat",:right=>true}%>
  <%end%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Times".t,:label=>"#{label}_time",:right=>false}%>
 <%=render :partial=>'per_controll_item',:locals=>{:name=>"Files".t,:label=>"#{label}_fs",:right=>false}%>
     <%=render :partial=>'per_controll_item',:locals=>{:name=>"Uncategorized".t,:label=>"#{label}_unc_fs_cat",:right=>true}%>
   <%(@project.nil? ? @cur_user.company : @project).file_categories.each do |cat|%>
    <%=render :partial=>'per_controll_item',:locals=>{:name=>cat.name,:label=>"#{label}_#{cat.id}_fs_cat",:right=>true}%>
  <%end%>
</table>
